﻿#pragma once

#ifndef QCEFRENDERAPP_H
#define QCEFRENDERAPP_H

#include "QCefApp.h"
#include "QCefRenderProcessHandler.h"
#include "QCefConfig.h"

class QCefRenderApp : public QCefApp, public QCefRenderProcessHandler
{
public:
    inline static QCefRenderApp * instance() { return ms_instance; }

protected:
    static QCefRenderApp * ms_instance;   //

public:
    QCefRenderApp();
    virtual ~QCefRenderApp();

public:
    //////////////////////////////////////////////////////////////////////////
    //CefApp
    virtual void OnBeforeCommandLineProcessing(const CefString& process_type,
                                               CefRefPtr<CefCommandLine> command_line) override;

    virtual CefRefPtr<CefRenderProcessHandler> GetRenderProcessHandler() override;

private:
    IMPLEMENT_REFCOUNTING(QCefRenderApp);
    DISALLOW_COPY_AND_ASSIGN(QCefRenderApp);
};

#endif  // QCEFRENDERAPP_H
